interface ProxyAlgorithm {
    increaseIndexes<T>(val: Array<T>): Array<T>
  }
  
  class algorithmProxy implements ProxyAlgorithm {
  
    constructor() { }
  
    // 数组每一项添加索引字段
    public increaseIndexes<T>(val: Array<T>): Array<T> {
      return Object.keys(val)
        .map((v) => {
          return {
            // @ts-ignore
            ...val[v],
            key: v
          }
        })
        .filter(v => !v.meta || !v.meta.hidden)
    }
  
  }
  
  export const algorithm = new algorithmProxy()